package org.thread.test05.tx.demo05.t04;

/**
 * 男孩 - 线程
 *
 * @author ZQX
 * @date 2025-03-14
 */
public class BoyThread extends Thread {

    /**
     * 男孩子要使用的篮子
     */
    private Box box ;
    /**
     * 男孩的姓名
     */
    private String name ;

    public BoyThread() {
    }

    public BoyThread(Box box, String name) {
        this.box = box;
        this.name = name;
    }

    @Override
    public void run() {
        while (true) {
            Fruit fruit = new Fruit();
            box.put(name,fruit);
        }
    }
}
